﻿using Architecture.Api.Application.Command.UserCommand;
using Architecture.Service;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.UserHandler
{
    public class UserDeleteCommandHandler : IRequestHandler<UserDeleteCommand, int>
    {
        private readonly IUserService _userService;

        public UserDeleteCommandHandler(IUserService userService)
        {
            _userService = userService;
        }
        //删除
        public async Task<int> Handle(UserDeleteCommand request, CancellationToken cancellationToken)
        {
            return await _userService.DeleteAsync(request.UserId);
        }
    }
}
